package com.tx.service.impl;

import com.tx.dao.LunBoDao;
import com.tx.entity.LunBo;
import com.tx.service.LunBoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author: tcx
 * @description: 轮播图业务层实现类
 * @Date: 2019/11/20
 **/
@Service
public class LunBoServiceImpl implements LunBoService {
    @Autowired
    private LunBoDao lunBoDao;
    /* *
     * @description:  添加轮播图
     * @author tcx
     * @date 2019/11/21
     * @param lunBo
     * @return void
     */
    public Integer add(LunBo lunBo) {
        //生成创建时间
        lunBo.setLcreateTime(new Date());
        return lunBoDao.insert(lunBo);
    }

    public Integer edit(LunBo lunBo) {
        return lunBoDao.update(lunBo);
    }

    public Integer remove(Integer lId) {
        return lunBoDao.delete(lId);
    }

    public List<LunBo> getAll() {
        return lunBoDao.selectAll();
    }
    public Integer getTotal(Map<String, Object> map) {
        return lunBoDao.getTotal(map);
    }

    public List<LunBo> list(Map<String, Object> map) {
        return lunBoDao.selectLunBoKey(map);
    }
}
